import request from '@/utils/request'

// 查询爬虫任务列表
export function listSpiderMission(query) {
  return request({
    url: '/spider/spiderMission/list',
    method: 'get',
    params: query
  })
}

// 查询爬虫任务详细
export function getSpiderMission(missionId) {
  return request({
    url: '/spider/spiderMission/' + missionId,
    method: 'get'
  })
}
// 运行爬虫
export function runMission(missionId) {
  return request({
    url: '/spider/spiderMission/runSpiderMission/' + missionId,
    method: 'post'
  })
}

// 新增爬虫任务
export function addSpiderMission(data) {
  return request({
    url: '/spider/spiderMission',
    method: 'post',
    data: data
  })
}

// 修改爬虫任务
export function updateSpiderMission(data) {
  return request({
    url: '/spider/spiderMission',
    method: 'put',
    data: data
  })
}

// 删除爬虫任务
export function delSpiderMission(missionId) {
  return request({
    url: '/spider/spiderMission/' + missionId,
    method: 'delete'
  })
}

// 导出爬虫任务
export function exportSpiderMission(query) {
  return request({
    url: '/spider/spiderMission/export',
    method: 'get',
    params: query
  })
}
// 导出爬虫任务
export function getconfigData(query) {
  return request({
    url: '/spider/spiderMission/export',
    method: 'get',
    params: query
  })
}
